#pragma once

#include "IPrimitive.h"
#include <list>

//
// l<bencoded values>e
// The initial l and trailing e are beginning and ending delimiters. 
// Lists may contain any bencoded type, including integers, strings, 
// dictionaries, and other lists.
//    Example: l4:spam4:eggse represents the list of two strings: [ "spam", "eggs" ]
//
namespace Torrent
{
    namespace Bencode
    {    
        class List : public IPrimitive
        {
        public:
            List(std::istream& stream);
            ~List(void);

            virtual void print(std::ostream& stream, bool debug = false);;
        private:
            typedef IPrimitive* ListElement;
            std::list<ListElement> _list;
        };
    } //Bencode
}//Torrent